<fieldset>
    <legend>条件搜索</legend>
    <form action="{:request()->url()}" autocomplete="off" class="layui-form layui-form-pane form-search" method="get" onsubmit="return false">

        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">产品名称</label>
            <label class="layui-input-inline">
                <input class="layui-input" name="name" placeholder="请输入产品名称" value="{:input('name','')}">
            </label>
        </div>

        {notempty name='companys'}
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">公司</label>
            <label class="layui-input-inline">
                <select class="layui-select" lay-search name="company_id">
                    <option value="">-- 全部公司 --</option>
                    {foreach $companys as $company}{if input('company_id') eq $company.id}
                    <option selected value="{$company.id}">{$company.name|default=''}</option>
                    {else}
                    <option value="{$company.id}">{$company.name|default=''}</option>
                    {/if}{/foreach}
                </select>
            </label>
        </div>
        {/notempty}

        {notempty name='cates'}
        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">分类</label>
            <div class="layui-input-inline">
                <label class="layui-input-inline">
                    <select class="layui-select" lay-search name="cate_id">
                        <option value="">-- 全部分类 --</option>
                        {foreach $cates as $cate}{if input('cate_id') eq $cate.id}
                        <option selected value="{$cate.id}">{$cate.name|default=''}</option>
                        {else}
                        <option value="{$cate.id}">{$cate.name|default=''}</option>
                        {/if}{/foreach}
                    </select>
                </label>
            </div>
        </div>
        {/notempty}

        <div class="layui-form-item layui-inline">
            <label class="layui-form-label">状态</label>
            <label class="layui-input-inline">
                <select class="layui-select" name="status">
                    <option value=''>-- 全部状态 --</option>
                    {foreach ['已下架','上架中'] as $k=>$v}
                    {if input('status','-') eq $k.''}
                    <option selected value="{$k}">{$v}</option>
                    {else}
                    <option value="{$k}">{$v}</option>
                    {/if}{/foreach}
                </select>
            </label>
        </div>


        <div class="layui-form-item layui-inline">
            <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
        </div>
    </form>
</fieldset>
